function [donors_combine,acceptors_combine] = extract_data(folder_path)
% 获取文件夹中的所有文件
files = dir(fullfile(folder_path, '*.TXT'));  % 获取所有 TXT 文件

% 初始化一个 cell 数组存储所有序列
sequences = cell(length(files), 1);   %存储最后提取的DNA序列
introns = cell(length(files), 1);   %存储提取的外显子/内含子以及内含子/外显子交界处

% 遍历每个文件并提取序列
for i = 1:length(files)
    file_path = fullfile(folder_path, files(i).name);  % 获取文件路径
    data = fileread(file_path);  % 读取文件内容
    sequence = regexp(data,'\(.*','match');   %由于DNA序列中存在'n'，先把')'后所有数据提取
    sequence = regexp(sequence(1), '[a-zA-Z]+', 'match');  % 提取序列部分（包括n）'
    intron = regexp(data,'\(.*\)','match');   %识别CDSjoin的括号部分
    intron = regexp(intron,'\d+','match');   %提取括号内的数字（交界处）
    introns(i) = intron;    %将提取到的边界处整合在一起
    t = sequence{1};   %将提取到的序列合并，然后整合在一起
    temper = t(1);
    for j = 2:size(t,2)
        temper = strcat(temper,t(j));
    end
    sequences{i} = temper;  % 存储序列
end
% 供体位点和受体位点窗口
for i = 1:length(files)
    temper = char(sequences{i});   %临时变量为sequences中的一个DNA序列
    in_temper = introns{i,1};   %该变量为CDSjoin中的数字
    n = 1;   %标记每个DNA的供体位点数目
    m = 1;   %标记每个DNA的受体位点数目
    for j = 1:length(in_temper)   %CDSjoin中每个数字都是一个边界
        if (mod(j,2) == 0) && (j < length(in_temper))   %供体位点为外显子/内含子边界，为CDSjoin中的偶数位数字，并不包含最后一个边界
            donor = char(in_temper(1,j));
            donor = str2double(donor);
            donors{i,n} = temper(donor-8:donor+9);   %gt为D+1和D+2
            n = n + 1;
        elseif(mod(j,2) == 1)   %受体位点为内含子/外显子边界，为CDSjoin的奇数位数字，且不包含第一个边界
            acceptor = char(in_temper(1,j));
            acceptor = str2double(acceptor);
           if(j > 1)
                acceptors{i,m} = temper(acceptor-27:acceptor+8);   %ag为D-2和D-1
                m = m + 1;
           end
        end
    end
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%合并donors
donors_combine = cell(1,1);
for i = 1:length(donors)
    j = 1;
    while(not(isempty(donors{i,j})))
        donors_combine = cat(1,donors_combine,donors(i,j));
        if j == size(donors,2)
            break;
        end
        j = j+1;
    end
end
donors_combine = donors_combine(2:length(donors_combine),:);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%合并acceptors
acceptors_combine = cell(1,1);
for i = 1:length(acceptors)
    j = 1;
    while(not(isempty(acceptors{i,j})))
        acceptors_combine = cat(1,acceptors_combine,acceptors(i,j));
        if j == size(acceptors,2)
            break;
        end
        j = j+1;
    end
end
acceptors_combine = acceptors_combine(2:length(acceptors_combine),:);